package cn.agiledata.bank.myspace.action;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import cn.agiledata.bank.common.service.NotifyUtil;
import cn.agiledata.bank.myspace.bean.AccountHisQueryDetailBean;
import com.vnv.infrastructure.exception.IPBException;

public class AccountQueryActionNoLogin extends AbstractMySpaceAction {
	
	
	public int hasAccessPermission(int accessLevel, HttpServletRequest request) throws IPBException {
		// TODO Auto-generated method stub
		return 1;
	}

	public ActionForward accountHisQueryDetail(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws IPBException, Exception {
		
		String tid = request.getParameter("transId");

		AccountHisQueryDetailBean aqb = getMySpaceService()
				.accountHisQueryDetail(tid, null);
		request.setAttribute("aqb", aqb);

		// 增加截止时间
		int[] leftTime = NotifyUtil.getPermissionLeftDHM(aqb.getT().getUpdateTime(), aqb.getT().getTransStatus());
		request.setAttribute("leftDays", "" + leftTime[0]);
		request.setAttribute("leftHours", "" + leftTime[1]);
		request.setAttribute("leftMinutes", "" + leftTime[2]);

		return mapping.findForward("accountHisQueryDetail");
	}
}
